<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMemberCardsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('member_cards', function (Blueprint $table) {
            $table->id()->comment('会员卡表');
            $table->integer('card_batch_id')->comment('卡批次id');
            $table->integer('user_id')->index()->comment('使用用户');
            $table->string('card_number',32)->comment('卡号');
            $table->string('reci_name',32)->nullable()->comment('领取人名称');
            $table->string('phone',32)->nullable()->comment('领取人手机号');
            $table->string('card_password',100)->comment('密码');
            $table->timestamp('use_time')->nullable()->comment('使用时间');
            $table->tinyInteger('status')->default(1)->comment('卡状态：0冻结,1激活');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('member_cards');
    }
}
